<?
include('config.inc.php');
include('sajax/sajax.php');
include('sajax/sajaxQueryBrowser.php');

sajax_init();
$sajax_request_type = "POST"; 
sajax_export("getColumnData");
sajax_handle_client_request();


$col      = $_GET['searchCol'];
$element  = $_GET['element'];
$dlgTitle = $_GET['dlgTitle'];

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Query Browser Window: <?=$element; ?></title>
	<link rel="STYLESHEET" href="../css/stylesMozilla.css">
	<SCRIPT src="../js/protaculous/prototype.js" language="JavaScript" type=text/javascript></SCRIPT>
	<SCRIPT src="../js/protaculous/scriptaculous.js?load=effects,dragdrop,combo,controls" language="JavaScript" type="text/javascript"></SCRIPT>
	<SCRIPT src="../js/jsQueryBrowser.js" language="JavaScript" type="text/javascript"></SCRIPT>
	<script language="JavaScript">	
	<? sajax_show_javascript(); ?>
	</script>
</head>
<body class="blueGradientBG" style="margin: 5px;" onLoad="start('<?=$element; ?>','<?=$col; ?>');">

<h2>Query Browser: <?=$dlgTitle; ?></h2>
<input type="hidden" id="searchCol" value="<?=$col; ?>" />
<input type="hidden" id="element" value="<?=$element; ?>" />

<input type="text" id="autocomplete" style="width: 240px;" name="autocomplete_parameter"/>
<div id="autocomplete_choices" class="autocomplete"></div>

<select id="searchColSelect" style="width: 120px;" onChange="switchColumn(this[this.selectedIndex].value); return false;" size="1"></select>
<div id="dataDiv"></div>


<script language="JavaScript">
var autoURL = 'sajax/sajaxQueryBrowser.php?fetch=1';
new Ajax.Autocompleter("autocomplete", "autocomplete_choices", autoURL, {callback: getSelectedColumn});
</script>

</body>
</html>